home *** CD-ROM | disk | FTP | other *** search
- class classes.misc.LaserBoost
- {
- var cMax;
- var c = 0;
- var c2 = 0;
- var c2Max = 20;
- var Name = "laserBoost";
- function LaserBoost(max)
- {
- this.cMax = max;
- _root.laserPower = 16;
- }
- function main()
- {
- this.c = this.c + 1;
- _root.laserPower = random(300) <= this.c - 50 ? 8 : 16;
- if(this.c == this.cMax)
- {
- _root.laserPower = 8;
- _root.currentBoost = "";
- _root.removePowerUp("laserBoost");
- }
- if(this.c < this.cMax / 3 && _root[_root.char].fire)
- {
- this.c2 = this.c2 + 1;
- this.c2Max /= 1.04;
- if(this.c2 >= Math.ceil(this.c2Max) + 1)
- {
- _root["gunSmoke" + this.c] = new classes.fx.GunSmoke(_root[_root.char].shotX,_root[_root.char].shotY,this.c);
- _root.addFX("gunSmoke" + this.c);
- this.c2 = 0;
- }
- }
- else if(this.c > this.cMax / 3 && _root[_root.char].fire)
- {
- this.c2 = this.c2 + 1;
- this.c2Max *= 1.03;
- if(this.c2 >= Math.ceil(this.c2Max) + 1)
- {
- _root["gunSmoke" + this.c] = new classes.fx.GunSmoke(_root[_root.char].shotX,_root[_root.char].shotY,this.c);
- _root.addFX("gunSmoke" + this.c);
- this.c2 = 0;
- }
- }
- }
- }
-